package xj.graph2d.shapes.block;

import xj.graph2d.DrawShape;
import xj.graph2d.DrawShapeBase;

public class MethodBlock 
  extends BlockShape {

  public MethodBlock() { 
    this(false);
  }

  public MethodBlock(boolean createComp) { 
    super(createComp);
    setBlockType(METHOD_BLOCK);
  }

  public MethodBlock(float x1, float y1, float x2, float y2,
		     boolean ctor) { 
    this(x1, y1, x2, y2, ctor, false);
  }

  public MethodBlock(float x1, float y1, float x2, float y2,
		     boolean ctor, 
		     boolean createComp) { 
    super(x1, y1, x2, y2, createComp);
    setBlockType(ctor ? CONSTRUCTOR_BLOCK : METHOD_BLOCK);
  }

  @Override
  public DrawShape makeInstance() {
    return new MethodBlock(comp != null);
  }

  @Override
  public void copyTo(DrawShapeBase s) 
    throws CloneNotSupportedException {
    super.copyTo(s);
    if (s instanceof MethodBlock) {
      MethodBlock b = (MethodBlock) s;

    }
  }

  public boolean isConstructor() {
    return blockType == CONSTRUCTOR_BLOCK;
  }

}